<?php
// api/price.php

include 'config.php'; // 
// 查询价格设置
$sql = "SELECT monthly_price, yearly_price, lifetime_price FROM price_settings";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    $row = $result->fetch_assoc();
    echo json_encode([
        'monthly_price' => $row['monthly_price'],
        'yearly_price' => $row['yearly_price'],
        'lifetime_price' => $row['lifetime_price']
    ]);
} else {
    http_response_code(404);
    echo json_encode(['error' => '价格设置未找到']);
}

$conn->close();
?>
